package com.voxel.sense.infomsg.module.firm.details.institution.list;

import android.view.View;
import android.widget.TextView;

import com.example.com.common.view.recycler.RecyclerAdapter;
import com.voxel.sense.infomsg.R;
import cyy.example.com.facotry.model.api.response.InstitutionEntity;

import butterknife.BindView;

/**
 * Created by ChenYiYao on 2018/7/25.
 */
public class InstitutionAdapter extends RecyclerAdapter<InstitutionEntity> {

    public InstitutionAdapter(AdapterListener<InstitutionEntity> listener) {
        super(listener);
    }

    @Override
    protected int getItemViewType(int position, InstitutionEntity institutionEntity) {
        return R.layout.item_recycler_institution;
    }

    @Override
    protected ViewHolder onCreateViewHolder(View root, int viewType) {
        return new Viewholder(root);
    }


    static class Viewholder extends ViewHolder<InstitutionEntity> {
        @BindView(R.id.tv_name)
        TextView tv_name;

        public Viewholder(View itemView) {
            super(itemView);
        }

        @Override
        protected void onBind(InstitutionEntity data) {

            tv_name.setText(data.getWatchSiteName());
        }
    }
}
